package com.itheima.extendsdemo;

public class Test1 {

    public static void main(String[] args) {

        //子类可以继承父类的非私有成员变量和成员方法
        //子类对象是由子类和父类多张设计图共同创建出的对象
        Teacher t = new Teacher();
        t.setName("张三");
        t.setAge(30);
        t.setGender("男");
        t.setTitle("教授");
        System.out.println(t.getName() + "，" + t.getAge() + "，" + t.getGender() + "，" + t.getTitle());

        Consultant c = new Consultant();
        c.setName("李四");
        c.setAge(28);
        c.setGender("女");
        c.setNumber(100);
        System.out.println(c.getName() + "，" + c.getAge() + "，" + c.getGender() + "，" + c.getNumber());
    }
}
